package com.balabala.gym_system.service.impl;

import com.balabala.gym_system.dao.AdvertisingDao;
import com.balabala.gym_system.pojo.dto.AdvertisingDto;
import com.balabala.gym_system.pojo.dto.BaseDeleteDto;
import com.balabala.gym_system.pojo.entity.Advertising;
import com.balabala.gym_system.service.AdvertisingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AdvertisingServiceImpl implements AdvertisingService {

    @Autowired
    private AdvertisingDao advertisingDao;


    @Override
    public void insertAd(Advertising advertising) {
        advertisingDao.insertAd(advertising);
    }

    @Override
    public void updateAd(Advertising advertising) {
        advertisingDao.updateAd(advertising);
    }

    @Override
    public void deleteById(String id) {
        advertisingDao.deleteById(id);
    }

    @Override
    public void deleteByIds(List<String> ids) {
        advertisingDao.deleteByIds(ids);
    }


    @Override
    public List<Advertising> findByStatus(Integer status) {
         List<Advertising> advertisingList = advertisingDao.findByStatus(status);
         return advertisingList;
    }

    @Override
    public Advertising findById(String id) {
        return advertisingDao.findById(id);
    }

    @Override
    public List<Advertising> findAll() {
        return advertisingDao.findAll();
    }

    @Override
    public List<Advertising> findAdByAdvertisingDto(AdvertisingDto advertisingDto) {
         List<Advertising> adByAdvertisingDto = advertisingDao.findAdByAdvertisingDto(advertisingDto);
         return adByAdvertisingDto;
    }

    @Override
    public Long findAdByAdvertisingDtoCount(AdvertisingDto advertisingDto) {
         Long adByAdvertisingDtoCount = advertisingDao.findAdByAdvertisingDtoCount(advertisingDto);
         return adByAdvertisingDtoCount;
    }

    @Override
    public List<Advertising> findAdByPosition(Integer position) {
         List<Advertising> adByPosition = advertisingDao.findAdByPosition(position);
         return adByPosition;
    }
}
